
*****replication file for 'responsiveness in an era of inequality: the case of the u.s. senate'

***use file 'prq data for dataverse.dta'

use "/Users/thayes/Desktop/Dissertation/Chapter 4-Representation/prq data for dataverse.dta"

**********TABLE 1 basic model*********
eststo clear

reg dwnom107 poorpct midpct1 richpct 
eststo
reg dwnom108 poorpct midpct1 richpct 
eststo
reg dwnom109 poorpct midpct1 richpct 
eststo
reg dwnom110 poorpct midpct1 richpct 
eststo
reg dwnom111 poorpct midpct1 richpct 
eststo
esttab using  "C:\Users\Tom\Desktop\Dissertation\basic.rtf", replace label se r2 starlevels(* .10 ** .05 *** .01) 

******TABLE 2, model w/ additional controls*****
eststo clear

reg dwnom107 poorpct midpct1 richpct black_pct gop107
eststo
reg dwnom108 poorpct midpct1 richpct black_pct gop108
eststo
reg dwnom109 poorpct midpct1 richpct black_pct gop109
eststo
reg dwnom110 poorpct midpct1 richpct black_pct gop110
eststo
reg dwnom111 poorpct midpct1 richpct black_pct gop111
eststo
esttab using  "C:\Users\Tom\Desktop\Dissertation\controlblck1.rtf", replace label se r2 starlevels(* .10 ** .05 *** .01) 


*********TABLE 3, w/ interactions*****
eststo clear

reg dwnom107 poorpct midpct1 richpct black_pct gop_low107 gop_mid107 gop_rich107 gop107 
eststo
reg dwnom108 poorpct midpct1 richpct black_pct gop_low108 gop_mid108 gop_rich108 gop108 
eststo
reg dwnom109 poorpct midpct1 richpct black_pct gop_low109 gop_mid109 gop_rich109 gop109
eststo
reg dwnom110 poorpct midpct1 richpct black_pct gop_low110 gop_mid110 gop_rich110 gop110 
eststo
reg dwnom111 poorpct midpct1 richpct black_pct gop_low111 gop_mid111 gop_rich111 gop111
eststo
esttab using  "C:\Users\Tom\Desktop\Dissertation\interactions.rtf", replace label se r2 starlevels(* .10 ** .05 *** .01) 

********figure 3******

reg dwnom110 poorpct midpct1 richpct 
margins, at(poorpct=(-.13(.1).33)) atmeans vsquish post 
marginsplot, recast(line) recastci(rarea) ciopts(color(gs14)) ylabel(-2(1)2) ymtick(-2(1)2)  ytitle("Predicted Probability (DW-NOMINATE)") xtitle("Low-Income Constituency Opinion") name(a)

reg dwnom110 poorpct midpct1 richpct 
margins, at(midpct1=(-.13(.1).33)) atmeans vsquish post 
marginsplot, recast(line) recastci(rarea) ciopts(color(gs14)) ylabel(-2(1)2) ymtick(-2(1)2)  ytitle("Predicted Probability (DW-NOMINATE)") xtitle("Middle-Income Constituency Opinion") name(b)

reg dwnom110 poorpct midpct1 richpct
margins, at(richpct=(-.13(.1).33)) atmeans vsquish post 
marginsplot, recast(line) recastci(rarea) ciopts(color(gs14)) ylabel(-2(1)2) ymtick(-2(1)2)  ytitle("Predicted Probability (DW-NOMINATE)") xtitle("Upper-Income Constituency Opinion") name(c)

graph combine a b c

****************************************************************





*************TABLE 4, natural experiment for 107th Congress*****

***use data file naturalexperiment.replication.dta

use "/Users/thayes/Desktop/Dissertation/Chapter 4-Representation/replication dataverse/naturalexperiment.replication.dta"

*******with cluster by state******
eststo clear

reg firstdbjs poorpct midpct1 richpct, cluster(state)
eststo
reg firstdbjs poorpct midpct1 richpct  gop107bjs, cluster(state)
eststo
reg firstdbjs poorpct midpct1 richpct gop107bjs gop_low107bs gop_mid107bs gop_rich107bs, cluster(state)
eststo
reg firstajs poorpct midpct1 richpct, cluster(state)
eststo
reg firstajs poorpct midpct1 richpct  gop107, cluster(state)
eststo
reg firstajs poorpct midpct1 richpct gop107 gop_low107as gop_mid107as gop_rich107as, cluster(state)
eststo
esttab using  "C:\Users\Tom\Desktop\Dissertation\naturalexperimentcluster.rtf", replace label se r2 starlevels(* .10 ** .05 *** .01) 

